package com.cpi.cornpp.common.files.dto;

import java.util.Calendar;

import com.cs.common.utils.StringUtils;

public class SAPComponentInternalOrderDTO implements SAPComponentDTO {
	private static final long serialVersionUID = 3388406463824512863L;
	private String code;
	private Calendar date;
	private String orderId;
	private String description;
	private double amount;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public Calendar getDate() {
		return date;
	}
	public void setDate(Calendar date) {
		this.date = date;
	}
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public double getAmount() {
		return amount;
	}
	public void setAmount(double amount) {
		this.amount = amount;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object object) {
		boolean equal = false;
		SAPComponentInternalOrderDTO sapComponentInternalOrderDTO = null;
		if( this == object ){
			equal = true;
		}else{
			if( this instanceof SAPComponentInternalOrderDTO ){
				sapComponentInternalOrderDTO = (SAPComponentInternalOrderDTO)object;
				if( this.hashCode() == sapComponentInternalOrderDTO.hashCode() ){
					equal = true;
				}
			}
		}
		return equal;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode(){
		int hash = 0;
		hash = (this.code!=null?this.code.hashCode():0);
		hash += (this.date!=null?this.date.hashCode():0);
		hash += (this.orderId!=null?this.orderId.hashCode():0);
		hash += (this.description!=null?this.description.hashCode():0);
		hash += new Double(this.amount).hashCode();
		return hash;
	}
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		StringBuffer toStringValue = null;
		toStringValue = new StringBuffer(0);
		toStringValue.append(getClass().getName());
		toStringValue.append(STRING_COLON);
		toStringValue.append(this.code);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.date!=null?this.date.getTime().toString():StringUtils.EMPTY_STRING);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.orderId);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.description);
		toStringValue.append(STRING_COMMA);
		toStringValue.append(this.amount);
		return toStringValue.toString();
	}
}